﻿using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace SS.Common.DBBuilder.DBDataStructure
{
    /// <summary>
    /// Present database corresponding with database from database server
    /// </summary>
    public class DataBase
    {
        #region Fields

        /// <summary>
        /// List table of database, it is corresponding with tables from database
        /// </summary>
        public IEnumerable<Table> Tables { get; set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Initialize an instance of database based on list of data table
        /// </summary>
        public DataBase(IEnumerable<DataTable> lstDataTbl)
        {
            this.Tables = lstDataTbl.Select(n => new Table(n)
                                                     {
                                                         DataBase = this
                                                     }).ToList();
        }

        #endregion
    }

}
